/**
 * Created by 66xiaoqu on 2015/10/26.
 */


var scoreService = require('../../../services/mis/score/scoreService');
var messageUtil = require('../../../common/utils/messageUtil');
var toolUtil = require('../../../common/utils/toolUtil');

exports.exchangeList = function(req, res) {

    scoreService.exchangeListService(req, function(err, results) {

        if (err) {
            logger.error('Exception happen when exchangeListService...' + err.message);
            res.json(messageUtil.composeFailedMessage(req, 'Exception happen when exchangeListService...'));
        }else {
            var data = {
                count:results[0]["count"],
                totalPage: results[0]["totalPage"],
                list: results[1]
            };
            res.json(messageUtil.composeSucceededMessage(req, null, data));
        }
    });
};